package com.survey.Controller;

import com.survey.pojo.vo.SurveyVO;
import com.survey.service.SurveyService;
import com.survey.utils.PageBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class SurveyAdminController {

    @Autowired
    SurveyService surveyService;
    @RequestMapping("/surveyAdmin/list")
    public String list(Model model, SurveyVO query) throws Exception {
        //SurveyVO query=new SurveyVO();
        //List<SurveyVO> list=surveyService.listAllSurvey();
        int PageSize=5;
        int Size=5;
        query.setPageSize(PageSize);
        query.setSize(Size);
        query.setIsopen(1);
        PageBean<SurveyVO> pageBean=surveyService.listSurvey(query);
        model.addAttribute("pageBean", pageBean);
        return "/admin/SurveyAdmin.jsp";

    }
}
